import 'package:cook_dinner/config/include.dart';
import 'package:flutter/material.dart';

class SettingView extends StatelessWidget {
  const SettingView({Key? key, this.children}) : super(key: key);

  final List<Widget>? children;

  @override
  Widget build(BuildContext context) {
    return Container(
      width: double.infinity,
      margin: EdgeInsets.only(bottom: 36.rpx),
      padding: EdgeInsets.only(
        left: 17.rpx,
        right: 20.rpx,
        top: 9.rpx,
        bottom: 9.rpx,
      ),
      decoration: BoxDecoration(
        color: Colors.white,
        borderRadius: BorderRadius.circular(10.rpx),
      ),
      child: Column(
        children: children ?? [],
      ),
    );
  }
}

class SettingItem extends StatelessWidget {
  const SettingItem(this.title, {Key? key}) : super(key: key);

  final String title;

  @override
  Widget build(BuildContext context) {
    return SizedBox(
      width: double.infinity,
      height: 46.rpx,
      child: Row(
        mainAxisAlignment: MainAxisAlignment.spaceBetween,
        children: [
          Text(
            title,
            style: TextStyle(
              color: const Color(0xff333333),
              fontSize: 18.rpx,
            ),
          ),
          Image.asset(
            'assets/images/backright.png',
            width: 12.rpx,
          ),
        ],
      ),
    );
  }
}
